unit ContaMovimentacaoSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, StdCtrls, DBGrids, DbCtrls, EditBtn, MainSearchFr;

type

  { TContaMovimentacaoSearchFrame }

  TContaMovimentacaoSearchFrame = class(TMainSearchFrame)
    data: TDateEdit;
    desc_plano_conta: TDBLookupComboBox;
    desc_conta: TDBLookupComboBox;
    id_plano_conta_movimentacao: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure LocalizarButtonClick(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses ContaMovimentacaoDM,QueryConditions;

{ TContaMovimentacaoSearchFrame }


procedure TContaMovimentacaoSearchFrame.LocalizarButtonClick(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
  condicoes := TQueryConditions.Create(CON_AND);
  condicoes.AddJoinField('ct.id_plano_conta','pc.id_plano_conta');
  condicoes.AddJoinField('c.id_conta','ct.id_conta');
  condicoes.Add('ct.id_plano_conta_movimentacao', id_plano_conta_movimentacao.Text);
  condicoes.AddText('c.desc_conta', desc_conta.Text);
  condicoes.AddText('pc.desc_plano_conta', desc_plano_conta.Text);
  condicoes.AddText('ct.data', data.Text);
  ContaMovimentacaoData.Search(Condicoes, 'plano_conta_movimentacao as ct, conta as c, plano_conta as pc');
end;

initialization
  {$I contamovimentacaosearchfr.lrs}

end.

